package cmd;

import javax.ws.rs.BeanParam;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;

import entity.User;

@Path("/test")
@Produces("application/json")
@Consumes("application/json")
public class TestResource {
    @GET
    public String getText() {
        return "hello lucky";
    }
    @GET
    @Path("/test2")
    	//	水电费发送到水电费
    public String getText2(
    		 @QueryParam("id") String id,
    		 
             @QueryParam("name") String name) {
    	
        return id+name;
    }
    
    @GET
    @Path("/test3")
    public User getText3() {
    	User s =new User(3,"duhao");
        return s;
    }
    
    @POST
    public User getText4(User u) {
    	User s =new User(4,"杜浩");
        return s;
    }
}
